Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 2, 2026

Summary

Establishes and enforces a consistent lifetime naming convention across the codebase:

Lifetime Meaning
'q Query source string (.ptk file content)
'd Diagnostics reference
's Source code string (tree-sitter input)
't Parsed tree-sitter tree
'a Any other (generic borrows, bytecode views)

Changes

  • Parser module: 'src'q, 'diag'd
  • Query module: Source<'a>Source<'q>, QueryContext<'a>QueryContext<'q>
  • Diagnostics module: DiagnosticBuilder<'a>DiagnosticBuilder<'d>, DiagnosticsPrinter<'a>DiagnosticsPrinter<'q>
  • Documentation: Added lifetime conventions section to AGENTS.md

Test plan

  • All 720 tests pass
  • cargo check passes
  • cargo clippy passes

@zharinov zharinov enabled auto-merge (squash) January 2, 2026 00:20
@zharinov zharinov merged commit 2d81c38 into master Jan 2, 2026
4 checks passed
@zharinov zharinov deleted the refactor/lifetime-convention branch January 2, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants